package com.bxg.tliaswebmanagement.controller;

import com.bxg.tliaswebmanagement.common.BaseResponse;
import com.bxg.tliaswebmanagement.common.ResultUtils;
import com.bxg.tliaswebmanagement.entity.Dept;
import com.bxg.tliaswebmanagement.service.DeptService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;

/**
 * @author BXG
 * @date 3/17/2025 9:59 上午
 */
//开启日志功能
@Slf4j
@RestController
public class DeptController {
    @Resource
    DeptService deptService;


//    @RequestMapping(value = "/depts",method = RequestMethod.GET)
    @GetMapping("/depts")
    public BaseResponse<List<Dept>> getDepts() {
        log.info("查询全部部门数据");
        List<Dept> data = deptService.list();
        return ResultUtils.success(data);
    }
}
